package com.ruoyi.gis.geoserver.domain;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

import java.io.Serializable;
import java.util.List;

/**
 * {
 * 	"GeoServerLayer": {
 * 		"expireClients": 0,
 * 		"gutter": 0,
 * 		"expireCache": 0,
 * 		"parameterFilters": [{
 * 			"defaultValue": "",
 * 			"key": "STYLES"
 *                }],
 * 		"metaWidthHeight": [4, 4],
 * 		"cacheWarningSkips": ["Default", "Nearest", "FailedNearest"],
 * 		"name": "testWs:youcai",
 * 		"inMemoryCached": true,
 * 		"mimeFormats": ["application/vnd.mapbox-vector-tile", "image/png", "image/jpeg"],
 * 		"id": "LayerInfoImpl--7e979745:18702a3320c:-7ff1",
 * 		"gridSubsets": [{
 * 			"gridSetName": "EPSG:4326"
 *        }, {
 * 			"gridSetName": "EPSG:900913"
 *        }],
 * 		"enabled": true* 	}
 * }
 *
 * https://blog.csdn.net/qq_20161461/article/details/111664807
 */
@JacksonXmlRootElement(localName = "GeoServerLayer")
public class GeoServerLayer implements Serializable {
    @JacksonXmlProperty(localName = "expireClients")
    private long expireClients;
    @JacksonXmlProperty(localName = "gutter")
    private long gutter;
    @JacksonXmlProperty(localName = "expireCache")
    private long expireCache;
//    @JacksonXmlElementWrapper(localName = "students")
//    @JacksonXmlProperty(localName = "student")
    @JacksonXmlElementWrapper(localName = "parameterFilters")
    @JacksonXmlProperty(localName = "styleParameterFilter")
    private List<ParameterFilter> parameterFilters;
    @JacksonXmlElementWrapper(localName = "metaWidthHeight")
    @JacksonXmlProperty(localName = "int")
//    private List<Integer> metaWidthHeight;
    private int[] metaWidthHeight;
    @JacksonXmlElementWrapper(localName = "cacheWarningSkips")
    @JacksonXmlProperty(localName = "warning")
//    private List<String> cacheWarningSkips;
    private String[] cacheWarningSkips;
    @JacksonXmlProperty(localName = "name")
    private String name;
    @JacksonXmlProperty(localName = "inMemoryCached")
    private boolean inMemoryCached;
    @JacksonXmlElementWrapper(localName = "mimeFormats")
    @JacksonXmlProperty(localName = "string")
//    private List<String> mimeFormats;
    private String[] mimeFormats;
    @JacksonXmlProperty(localName = "id")
    private String id;
    @JacksonXmlElementWrapper(localName = "gridSubsets")
    @JacksonXmlProperty(localName = "gridSubset")
    private List<GridSubset> gridSubsets;
    @JacksonXmlProperty(localName = "enabled")
    private boolean enabled;
    private String sourceUrl;


    public String getSourceUrl() {
        return sourceUrl;
    }

    public void setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
    }

    public int[] getMetaWidthHeight() {
        return metaWidthHeight;
    }

    public void setMetaWidthHeight(int[] metaWidthHeight) {
        this.metaWidthHeight = metaWidthHeight;
    }

    public String[] getCacheWarningSkips() {
        return cacheWarningSkips;
    }

    public void setCacheWarningSkips(String[] cacheWarningSkips) {
        this.cacheWarningSkips = cacheWarningSkips;
    }

    public String[] getMimeFormats() {
        return mimeFormats;
    }

    public void setMimeFormats(String[] mimeFormats) {
        this.mimeFormats = mimeFormats;
    }

    public long getExpireClients() {
        return expireClients;
    }

    public void setExpireClients(long expireClients) {
        this.expireClients = expireClients;
    }

    public long getGutter() {
        return gutter;
    }

    public void setGutter(long gutter) {
        this.gutter = gutter;
    }

    public long getExpireCache() {
        return expireCache;
    }

    public void setExpireCache(long expireCache) {
        this.expireCache = expireCache;
    }

    public List<ParameterFilter> getParameterFilters() {
        return parameterFilters;
    }

    public void setParameterFilters(List<ParameterFilter> parameterFilters) {
        this.parameterFilters = parameterFilters;
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isInMemoryCached() {
        return inMemoryCached;
    }

    public void setInMemoryCached(boolean inMemoryCached) {
        this.inMemoryCached = inMemoryCached;
    }



    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public List<GridSubset> getGridSubsets() {
        return gridSubsets;
    }

    public void setGridSubsets(List<GridSubset> gridSubsets) {
        this.gridSubsets = gridSubsets;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
}
